import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router'
import VueResource from 'vue-resource'
import Vuex from 'vuex'
Vue.use(VueRouter)
Vue.use(VueResource)
Vue.use(Vuex)

const Home = { template: '<div>这是首页！</div>' }
const Foo = { template: '<div>This is Foo</div>' }
const Bar = { template: '<div>This is Bar {{ $route.params.id }}</div>' }
import Show from './component/show.vue'
import List from './component/list.vue'
import Index from './component/index.vue'

const router = new VueRouter({
  mode: 'history',
  base: __dirname,
  routes: [
    { path: '/', name: 'home', component: Index },
    { path: '/foo', name: 'foo', component: Foo },
    { path: '/list/:id', name: 'list', component: List },
    { path: '/show/:id/:sid', name: 'show', component: Show }
  ]
})

const store = new Vuex.Store({
  state: {
    count: 0
  }
})

new Vue({
  router,
  render: h => h(App),
  data:{
  	title:"123456"
  }
}).$mount('#app')